import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id?: number
  name: String
  real_name: string
  mobile: string
  address: string
  long: string
  lat: string
  user_name: string
  bank_type: string
  bank_branch: string
  bank_no: string
  is_on_credit: string
  credit_days: string
  money: string
  type: string
}

// 门店列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/store/list', data })
}
// 门店列表新增
export const createApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/store/create', data })
}
// 门店修改
export const modifyApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/store/modify', data })
}
// 门店列表删除
export const delApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/store/del', data })
}
// 门店列表详情
export const detailsApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/store/details', data })
}
